package org.javaboy.jsonb_demo.config;

import jakarta.json.bind.Jsonb;
import jakarta.json.bind.JsonbBuilder;
import jakarta.json.bind.JsonbConfig;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.Locale;

@Configuration
public class JsonBConfig {
    @Bean
    public Jsonb jsonb() {
        JsonbConfig config = new JsonbConfig();
        config.withDateFormat("yyyy-MM-dd HH:mm", Locale.CHINA);
        return JsonbBuilder.create(config);
    }
}
